<?php
          class canonprofess extends model {
           
           function view(){ 
           


                         
                          if($this->info['parameter'][0]=='add'&&is_numeric($this->info['parameter'][1]))
                          {

                            require_once('feature.php');
                            $feature=new feature();
                            $feature->view(); 
                             exit;
                          }
           
           
                $name='imagewidth';
             eval("\$obj = new Plugins_".ucfirst($name).'($this->db);');  
              $arraydata=$obj->getformadd();
              $arraynewdata['formadd'][$name]=str_replace(array("\r", "\n", "\r"), '', $arraydata['form']).'<input type="hidden" value="14" name="plugid[]"><input type="hidden" value="'.$name.'" name="plugname[]">';
              
              
              
              
              $name='text';
             eval("\$obj = new Plugins_".ucfirst($name).'($this->db);');  
              $arraydata=$obj->getformadd();
              $arraynewdata['formadd'][$name]=str_replace(array("\r", "\n", "\r"), '', $arraydata['form']).'<input type="hidden" value="8" name="plugid[]"><input type="hidden" value="'.$name.'" name="plugname[]">';
              
              
              $arraynewdata['check']=false;
              if($this->userdata['oauth']&&($this->userdata['roleid']=='2'||$this->userdata['roleid']=='3'||$this->userdata['roleid']=='4'))
              {
              $arrayuser=$this->getuserbyoauth($this->userdata['oauth']);
             $userid=$arrayuser['userid'];
             if($userid)
             {
             $featurearray=$this->getfeaturebyname('canonprofess');
             
             $sql='select count(*) as countproduct from tb_product where tb_product.fid='.$featurearray['fid'].' and tb_product.createby='.$arrayuser['userid'].' and tb_product.delete=0';
             $checkcountproduct=$this->db->db_set_1recordrow($sql);
             if(intval($checkcountproduct['countproduct'])>=3)
             {
             
             $arraynewdata['check']=true;
             
             }
           
             
             }
             
              }
           

                      $this->loadtemplate('canonprofess',$arraynewdata);  
           
           
           }
           
          }
?>
